<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>15-函数的简单创建</title>
	</head>
	<body>
		<script type="text/javascript">
			//以下分析无意义
 			/*//随意2个数字，进行加法减法乘法...运算
			function countN(num1,num2){
				var last = num1+num2;
				console.log(last);
			}
			function countM(num1,num2){
				var last = num1-num2;
				console.log(last);
			}
			//方法调用
			countN(1,2);
			countM(1,2); */
			
			//随意2个数字，进行加法减法乘法...运算
			/**
			 * @param {数字1} num1
			 * @param {数字2} num2
			 * @param {类型} type  + - *
			 */
			function countN(num1,num2,type){
				//声明一个变量去接收
				var last = 0;
				console.log("获取实际参数::"+num1+'='+num2+'='+type);
				switch(type){
					case '+':
						last = num1+num2;
						break;
					case '-':
						last = num1-num2;
						break;
					case '*':
						last = num1*num2;
						break;
					default:
						alert('别乱输了...');
						break;
				}
				console.log("运算的值::"+last)
			}
			
			//调用
			countN(1,7,'+');
			countN(1,7,'-');
			countN(1,7,'*');
			countN(1,7,'%%');
			
			
			
			
			
		</script>
	</body>
</html>
